package com.h5lib.nchupfficeApp;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class IoUtil {

	/**
	 * 复制
	 * @param in
	 * @param out
	 */
	public static void copy(InputStream in ,OutputStream out){
		try {
			byte[] buff = new byte[1024*10];
			int len = -1;
			while((len = in.read(buff)) != -1){
				out.write(buff, 0, len);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			if(in != null){
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			if(out != null){
				try {
					out.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			
		}

		
		
	}
	
}
